package com.common.util;

/**
 * 枚举类，封装返回状态码
 *
 * @Author IanZy
 * @Date 2020/6/15
 */
public enum ResultUtil {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(400, "参数验证失败"),
    UNAUTHORIZED(401, "未认证"),
    FORBIDDEN(403, "未授权");

    private Integer code;
    private String msg;

    private ResultUtil(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
